﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using XCore.Domain.Entities;
using XCore.Domain.Enums;

namespace SaaS.Model.Entity.Logs
{
    /// <summary>
    /// 请求追踪日志
    /// </summary>
    [Table("TraceLogs")]
    public class TraceLog : Entity<long>, IHasCreationTime, IHasCreateionIpAddress
    {
        /// <summary>
        /// 请求地址
        /// </summary>
        [StringLength(1024)]
        public string Path { get; set; }
        /// <summary>
        /// 请求耗时
        /// </summary>
        public long Duration { get; set; }
        /// <summary>
        /// 请求客户端系统类型
        /// </summary>
        public SystemType Type { get; set; }
        /// <summary>
        /// 执行时间
        /// </summary>
        public DateTime CreationTime { get; set; }
        /// <summary>
        /// 创建IP地址
        /// </summary>
        [StringLength(32)]
        public string IP { get; set; }
        /// <summary>
        /// 请求信息
        /// </summary>
        public string RequestInfo { get; set; }
    }
}
